<template>
	<view id="top">

		<view class="">
			美团
		</view>
		<view class="">
			大众
		</view>
	</view>
	<view id="Verification">
		美团、大众点评自助验券
	</view>
	<view id="VoucherCheckingBox">
		<input v-model="ExchangeCode" type="text" placeholder="点击输入卡券验证码" >
		<view class="iconfont icon-weibiaoti1"></view>
	</view>
	<view id="viBottom" class="button-sp-area">
		<button class="mini-btn" type="default" size="mini" @click="postData">验券</button>
	</view>
</template>

<script>
	import http from "../../utils/http.js"
	export default {
		data() {
			return {
				ExchangeCode:""
			};
		},
		methods: {
			postData: function() {
				http({
					url: '/code/cdkey',
					method: 'post',
					params: {
						code:this.ExchangeCode ,
						userId:9527
					}
				}).then((res) => {
					if (res.code== 0) {
						wx.showToast({
							title: '验券成功!',
							icon: 'success',
							duration: 1000, //持续的时间,
						})
					} else {
						wx.showToast({
							title: '验券失败!',
							icon: 'error',
							duration: 1000, //持续的时间,
						})
					}
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	@import url("../../static/fonts/iconfont.css");

	
#viBottom{
	height:100rpx;
	width:1000rpx;
	padding-left:100rpx;
	padding-top:50rpx;
}	
#viBottom button{
	padding: 10rpx 250rpx;
	background:#c6964f;
	color:#ffffff;
}
	#top {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 200rpx;
		padding-top: 130rpx;
		border-top: 1rpx solid #aaaaaa;
	}

	#top view {
		color: #fff;
		width: 100rpx;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		border-radius: 50%;
	}

	#top view:nth-child(1) {
		background: #d7cf09;
	}

	#top view:nth-child(2) {
		background: #00bfbf;
	}

	#Verification {
		text-align: center;
		font-size: 28rpx;
		font-weight: 800;
	}

	#VoucherCheckingBox {
		width: 640rpx;
		margin: 0 auto;
		display: flex;
		margin-top: 25rpx;
		padding-bottom: 20rpx;
		border-bottom: 1rpx solid #aaaaaa;
	}

	#VoucherCheckingBox input {
		padding-left: 200rpx;
	}
</style>
